package msc.ai.crypto.jade.security.keymanager;

import java.util.Date;
import java.util.HashMap;

import javax.crypto.SecretKey;

public class TicketStoreEntry
{
	// FIXME : Use only two agents????
	// Does this has functionality to share a key between more than two parties
	private HashMap<String, String> agentLst;
	private SecretKey sharedKey;
	private Date createTime;
	private Date lastAccessTime;
	
	public TicketStoreEntry(SecretKey sharedKey)
	{
		super();
		this.sharedKey= sharedKey;
		this.createTime = new Date(System.currentTimeMillis());
		
	}

	public boolean hasAgent(String agentId)
	{
		boolean hasAgent = false;
		
		if (this.agentLst != null)
		{
			hasAgent = this.agentLst.containsKey(agentId);
		}
				
		return hasAgent;
	}
	
	public HashMap<String, String> getAgentLst()
	{
		return agentLst;
	}

	public void setAgentLst(HashMap<String, String> agentLst)
	{
		this.agentLst = agentLst;
	}

	public SecretKey getSharedKey()
	{
		return sharedKey;
	}

	public void setSharedKey(SecretKey sharedKey)
	{
		this.sharedKey = sharedKey;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

//	public void setCreateTime(Date createTime)
//	{
//		this.createTime = createTime;
//	}

	public Date getLastAccessTime()
	{
		return lastAccessTime;
	}

//	public void setLastAccessTime(Date  lastAccessTime)
//	{
//		this.lastAccessTime = lastAccessTime;
//	}
	
	
	
}
